package com.ht.dsp;

import com.ht.aems.fesmodel.RtMeasureQuery;
import com.ht.aems.fesmodel.RtMeasureSaver;
import com.ht.aems.measure.MeasureTypeConstants;
import com.ht.aems.measure.SystemMeasure;
import com.ht.aems.ntp.CimToIEEE;
import com.ht.aems.se.SeResultInfo;
import com.ht.aems.util.RtDataHandler;

import java.util.HashMap;
import java.util.Map;

/**
 * Model of dsp, contains:</br>
 * scada data</br>
 * se result</br>
 * compute model(ieee island, cim island and their index</br>
 *
 * @author Dong Shufeng
 *         Date: 2008-9-25
 */
public class DspSysModel implements MeasureTypeConstants {

    public static DspSysModel INSTANCE = new DspSysModel();

    private boolean isScadaDataLocked = false;
    private boolean isComputeModelLocked = false;
    private long seStartTime = 0;
    private long seEndTime = 0;
    private long seSectionTime = 0;
    private long scadaDataTime = System.currentTimeMillis();
    private Map<String, Integer> scadaDiscrete = new HashMap<String, Integer>();
    private Map<String, Double> scadaAnalog = new HashMap<String, Double>();
    private Map<Integer, Integer> seDiscrete = new HashMap<Integer, Integer>();
    private Map<String, Double> seAnalog = new HashMap<String, Double>();
    private Map<CimToIEEE, SystemMeasure> computeModel = new HashMap<CimToIEEE, SystemMeasure>();
    private Map<CimToIEEE, SeResultInfo> seResults = new HashMap<CimToIEEE, SeResultInfo>();
    private RtDataHandler rtDataHandler;
    private RtMeasureQuery rtMeasureQuery;
    private RtMeasureSaver rtMeasureSaver;

    private DspSysModel() {
    }

    public boolean isScadaDataLocked() {
        return isScadaDataLocked;
    }

    public void setScadaDataLocked(boolean scadaDataLocked) {
        isScadaDataLocked = scadaDataLocked;
    }

    public long getSeStartTime() {
        return seStartTime;
    }

    public void setSeStartTime(long seStartTime) {
        this.seStartTime = seStartTime;
    }

    public long getSeEndTime() {
        return seEndTime;
    }

    public void setSeEndTime(long seEndTime) {
        this.seEndTime = seEndTime;
    }

    public long getSeSectionTime() {
        return seSectionTime;
    }

    public void setSeSectionTime(long seSectionTime) {
        this.seSectionTime = seSectionTime;
    }

    public long getScadaDataTime() {
        return scadaDataTime;
    }

    public void setScadaDataTime(long scadaDataTime) {
        this.scadaDataTime = scadaDataTime;
    }

    public Map<CimToIEEE, SystemMeasure> getComputeModel() {
        return computeModel;
    }

    public void setComputeModel(Map<CimToIEEE, SystemMeasure> computeModel) {
        this.computeModel = computeModel;
    }

    public Map<String, Integer> getScadaDiscrete() {
        return scadaDiscrete;
    }


    public Map<String, Double> getScadaAnalog() {
        return scadaAnalog;
    }


    public Map<Integer, Integer> getSeDiscrete() {
        return seDiscrete;
    }

    public Map<String, Double> getSeAnalog() {
        return seAnalog;
    }

    public Map<CimToIEEE, SeResultInfo> getSeResults() {
        return seResults;
    }

    public RtDataHandler getRtDataHandler() {
        return rtDataHandler;
    }

    public void setRtDataHandler(RtDataHandler rtDataHandler) {
        this.rtDataHandler = rtDataHandler;
    }

    public boolean isComputeModelLocked() {
        return isComputeModelLocked;
    }

    public void setComputeModelLocked(boolean computeModelLocked) {
        isComputeModelLocked = computeModelLocked;
    }

    public RtMeasureQuery getRtMeasureQuery() {
        return rtMeasureQuery;
    }

    public void setRtMeasureQuery(RtMeasureQuery rtMeasureQuery) {
        this.rtMeasureQuery = rtMeasureQuery;
    }

    public RtMeasureSaver getRtMeasureSaver() {
        return rtMeasureSaver;
    }

    public void setRtMeasureSaver(RtMeasureSaver rtMeasureSaver) {
        this.rtMeasureSaver = rtMeasureSaver;
    }
}

